<?php
/**
 * XML文档
 *
 * @version $Id: IMintXMLDocument.php 312 2008-04-23 16:29:38Z iwind $
 * @package util.mint.format
 */
class IMintXMLDocument extends IObject implements IMintDocument {
	/**
	 * Enter description here...
	 *
	 * @var DOMDocument
	 */
	private $domDocument;
	
	/**
	 * 构造
	 *
	 */
	public function __construct() {
		$this->domDocument = new DOMDocument();
	}
	
	/**
	 * 从文本中取得DOMDocument
	 *
	 * @param string $text 文本
	 * @return DOMDocument
	 */
	public function load($text) {
		$this->domDocument->loadXML($text);
	}
	
	/**
	 * 将文档转换成字符串
	 *
	 * @return string
	 */
	public function __toString() {
		return $this->domDocument->saveXML();
	}
	
	/**
	 * 取得DOMDocument对象
	 *
	 * @return DOMDocument
	 */
	public function getDOMDocument() {
		return $this->domDocument;
	}	
}


?>